﻿using System;
using System.IO;
using System.Web;
using SyCODE.SearchEngine.Analysis;

namespace SyCODE.Blog
{
    /// <summary>
    /// Analysis.aspx 的处理程序。
    /// 作用：
    ///   分词演示
    /// </summary>
    public class Analysis : IHttpHandler
    {
        public bool IsReusable
        {
            get
            {
                return true;
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            TextReader tr = new StringReader(context.Request.Form["s"]);
            ThesaurusSpliter spliter = new ThesaurusSpliter(tr);
            for (string word = spliter.Next(); word != null; word = spliter.Next())
            {
                if (word.Length > 0)
                    context.Response.Write(word + " ");
            }
        }
    }
}
